<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>表单数据的自动收集</title>
</head>

<body>
    <div id="app">
        <form action="/xxx" @submit.prevent="handleSubmit">
            <span>用户名：</span>
            <input type="text" v-model="username"><br>

            <span>密码</span>
            <input type="password" v-model="pwd"><br>

            <span>性别</span>
            <input type="radio" id="female">
            <label for="female">女</label>
            <input type="radio" id="male">
            <label for="male">男</label><br>
            <span>爱好：</span>
            <input type="checkbox" id="basket">
            <label for="basket">篮球</label>
            <input type="checkbox" id="foot">
            <label for="foot">足球</label>
            <input type="checkbox" id="pingpang">
            <label for="pingpang">乒乓</label><br>
            <span>城市：</span>
            <select>
                <option value="">未选择</option>
            </select><br>
            <span>介绍</span>
            <textarea rows="10"></textarea><br><br>
            <input type="submit" value="注册">
        </form>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                username: '',
                pwd: ''
            },
            methods: {
                handleSubmit() {
                    console.log(this.username, this.pwd)
                }
            }
        })
    </script>
</body>

</html>